{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "import os\n",
    "from os.path import dirname, realpath, join\n",
    "base_dir = dirname(dirname(os.getcwd()))\n",
    "\n",
    "import pandas as pd\n",
    "from os.path import join\n",
    "sys.path.insert(0, base_dir)\n",
    "from config_path import PROSTATE_DATA_PATH, PLOTS_PATH, DATA_PATH"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "filename = join(PROSTATE_DATA_PATH,'processed/outputs_su2c_tcga_all_samples_n=980_rsem_results_filtered.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(filename)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(12480801, 11)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gene_id</th>\n",
       "      <th>transcript_id(s)</th>\n",
       "      <th>length</th>\n",
       "      <th>effective_length</th>\n",
       "      <th>expected_count</th>\n",
       "      <th>TPM</th>\n",
       "      <th>FPKM</th>\n",
       "      <th>sample</th>\n",
       "      <th>sequencing_type</th>\n",
       "      <th>tpm_id</th>\n",
       "      <th>HUGO_gene</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>ENSG00000000003.14_2_TSPAN6</td>\n",
       "      <td>ENST00000373020.8_1_TSPAN6-201,ENST00000494424...</td>\n",
       "      <td>1872.50</td>\n",
       "      <td>1630.51</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0.29</td>\n",
       "      <td>0.20</td>\n",
       "      <td>MO_1008-Tumor_Dura</td>\n",
       "      <td>tcap</td>\n",
       "      <td>MO_1008-Tumor_Dura_tcap</td>\n",
       "      <td>TSPAN6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ENSG00000000003.14_2_TSPAN6</td>\n",
       "      <td>ENST00000373020.8_1_TSPAN6-201,ENST00000494424...</td>\n",
       "      <td>2206.00</td>\n",
       "      <td>1985.25</td>\n",
       "      <td>690.0</td>\n",
       "      <td>22.29</td>\n",
       "      <td>22.98</td>\n",
       "      <td>MO_1012-Tumor-Subcutaneous_nodule</td>\n",
       "      <td>polyA</td>\n",
       "      <td>MO_1012-Tumor-Subcutaneous_nodule_polyA</td>\n",
       "      <td>TSPAN6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>ENSG00000000003.14_2_TSPAN6</td>\n",
       "      <td>ENST00000373020.8_1_TSPAN6-201,ENST00000494424...</td>\n",
       "      <td>2243.05</td>\n",
       "      <td>1987.86</td>\n",
       "      <td>247.0</td>\n",
       "      <td>2.94</td>\n",
       "      <td>3.04</td>\n",
       "      <td>MO_1013-Tumor</td>\n",
       "      <td>polyA</td>\n",
       "      <td>MO_1013-Tumor_polyA</td>\n",
       "      <td>TSPAN6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>ENSG00000000003.14_2_TSPAN6</td>\n",
       "      <td>ENST00000373020.8_1_TSPAN6-201,ENST00000494424...</td>\n",
       "      <td>2242.55</td>\n",
       "      <td>1990.72</td>\n",
       "      <td>1482.0</td>\n",
       "      <td>18.63</td>\n",
       "      <td>21.03</td>\n",
       "      <td>MO_1014-Tumor</td>\n",
       "      <td>polyA</td>\n",
       "      <td>MO_1014-Tumor_polyA</td>\n",
       "      <td>TSPAN6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>ENSG00000000003.14_2_TSPAN6</td>\n",
       "      <td>ENST00000373020.8_1_TSPAN6-201,ENST00000494424...</td>\n",
       "      <td>2159.61</td>\n",
       "      <td>1898.68</td>\n",
       "      <td>402.0</td>\n",
       "      <td>9.84</td>\n",
       "      <td>7.36</td>\n",
       "      <td>MO_1015-Tumor</td>\n",
       "      <td>tcap</td>\n",
       "      <td>MO_1015-Tumor_tcap</td>\n",
       "      <td>TSPAN6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       gene_id  \\\n",
       "0  ENSG00000000003.14_2_TSPAN6   \n",
       "1  ENSG00000000003.14_2_TSPAN6   \n",
       "2  ENSG00000000003.14_2_TSPAN6   \n",
       "3  ENSG00000000003.14_2_TSPAN6   \n",
       "4  ENSG00000000003.14_2_TSPAN6   \n",
       "\n",
       "                                    transcript_id(s)   length  \\\n",
       "0  ENST00000373020.8_1_TSPAN6-201,ENST00000494424...  1872.50   \n",
       "1  ENST00000373020.8_1_TSPAN6-201,ENST00000494424...  2206.00   \n",
       "2  ENST00000373020.8_1_TSPAN6-201,ENST00000494424...  2243.05   \n",
       "3  ENST00000373020.8_1_TSPAN6-201,ENST00000494424...  2242.55   \n",
       "4  ENST00000373020.8_1_TSPAN6-201,ENST00000494424...  2159.61   \n",
       "\n",
       "   effective_length  expected_count    TPM   FPKM  \\\n",
       "0           1630.51            14.0   0.29   0.20   \n",
       "1           1985.25           690.0  22.29  22.98   \n",
       "2           1987.86           247.0   2.94   3.04   \n",
       "3           1990.72          1482.0  18.63  21.03   \n",
       "4           1898.68           402.0   9.84   7.36   \n",
       "\n",
       "                              sample sequencing_type  \\\n",
       "0                 MO_1008-Tumor_Dura            tcap   \n",
       "1  MO_1012-Tumor-Subcutaneous_nodule           polyA   \n",
       "2                      MO_1013-Tumor           polyA   \n",
       "3                      MO_1014-Tumor           polyA   \n",
       "4                      MO_1015-Tumor            tcap   \n",
       "\n",
       "                                    tpm_id HUGO_gene  \n",
       "0                  MO_1008-Tumor_Dura_tcap    TSPAN6  \n",
       "1  MO_1012-Tumor-Subcutaneous_nodule_polyA    TSPAN6  \n",
       "2                      MO_1013-Tumor_polyA    TSPAN6  \n",
       "3                      MO_1014-Tumor_polyA    TSPAN6  \n",
       "4                       MO_1015-Tumor_tcap    TSPAN6  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "18927"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(df.gene_id.unique())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "18927"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(df['transcript_id(s)'].unique())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "mapping_file = join(PROSTATE_DATA_PATH, 'raw_data/sample_mapping.tsv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "mapping_id = pd.read_csv(mapping_file, sep='\\t')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Tumor_Sample_Barcode</th>\n",
       "      <th>patient</th>\n",
       "      <th>rna_sample_id</th>\n",
       "      <th>tpm_col</th>\n",
       "      <th>fusion_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>TCGA-EJ-5499</td>\n",
       "      <td>PRAD-TCGA-EJ-5499-Tumor-SM-1U3IG</td>\n",
       "      <td>PRAD-EJ-5499-TP</td>\n",
       "      <td>PRAD-EJ-5499-TP_polyA</td>\n",
       "      <td>PRAD-EJ-5499-TP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>MO_1012</td>\n",
       "      <td>MO_1012-Tumor-Abdomen_wall_nodule</td>\n",
       "      <td>MO_1012-Tumor-Subcutaneous_nodule</td>\n",
       "      <td>MO_1012-Tumor-Subcutaneous_nodule_polyA</td>\n",
       "      <td>MO_1012-Tumor-Subcutaneous_nodule</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TCGA-CH-5752</td>\n",
       "      <td>PRAD-TCGA-CH-5752-Tumor-SM-1U3ID</td>\n",
       "      <td>PRAD-CH-5752-TP</td>\n",
       "      <td>PRAD-CH-5752-TP_polyA</td>\n",
       "      <td>PRAD-CH-5752-TP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>06-134H1_LN</td>\n",
       "      <td>06-134H1_LN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>SC_9126</td>\n",
       "      <td>SC_9126_Tumor</td>\n",
       "      <td>SC_9126_Tumor</td>\n",
       "      <td>SC_9126_Tumor_tcap</td>\n",
       "      <td>SC_9126_Tumor</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Tumor_Sample_Barcode                            patient  \\\n",
       "0         TCGA-EJ-5499   PRAD-TCGA-EJ-5499-Tumor-SM-1U3IG   \n",
       "1              MO_1012  MO_1012-Tumor-Abdomen_wall_nodule   \n",
       "2         TCGA-CH-5752   PRAD-TCGA-CH-5752-Tumor-SM-1U3ID   \n",
       "3          06-134H1_LN                        06-134H1_LN   \n",
       "4              SC_9126                      SC_9126_Tumor   \n",
       "\n",
       "                       rna_sample_id                                  tpm_col  \\\n",
       "0                    PRAD-EJ-5499-TP                    PRAD-EJ-5499-TP_polyA   \n",
       "1  MO_1012-Tumor-Subcutaneous_nodule  MO_1012-Tumor-Subcutaneous_nodule_polyA   \n",
       "2                    PRAD-CH-5752-TP                    PRAD-CH-5752-TP_polyA   \n",
       "3                                NaN                                      NaN   \n",
       "4                      SC_9126_Tumor                       SC_9126_Tumor_tcap   \n",
       "\n",
       "                         fusion_name  \n",
       "0                    PRAD-EJ-5499-TP  \n",
       "1  MO_1012-Tumor-Subcutaneous_nodule  \n",
       "2                    PRAD-CH-5752-TP  \n",
       "3                                NaN  \n",
       "4                      SC_9126_Tumor  "
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mapping_id.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [],
   "source": [
    "mapping_id = mapping_id[['Tumor_Sample_Barcode','tpm_col']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "mapping_id.dropna(subset = ['tpm_col'], inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Tumor_Sample_Barcode</th>\n",
       "      <th>tpm_col</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>TCGA-EJ-5499</td>\n",
       "      <td>PRAD-EJ-5499-TP_polyA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>MO_1012</td>\n",
       "      <td>MO_1012-Tumor-Subcutaneous_nodule_polyA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>TCGA-CH-5752</td>\n",
       "      <td>PRAD-CH-5752-TP_polyA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>SC_9126</td>\n",
       "      <td>SC_9126_Tumor_tcap</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>PROS01448-6115227-SM-67ERU</td>\n",
       "      <td>PROS01448-6115227-Tumor-SM-67ERU_polyA</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         Tumor_Sample_Barcode                                  tpm_col\n",
       "0                TCGA-EJ-5499                    PRAD-EJ-5499-TP_polyA\n",
       "1                     MO_1012  MO_1012-Tumor-Subcutaneous_nodule_polyA\n",
       "2                TCGA-CH-5752                    PRAD-CH-5752-TP_polyA\n",
       "4                     SC_9126                       SC_9126_Tumor_tcap\n",
       "6  PROS01448-6115227-SM-67ERU   PROS01448-6115227-Tumor-SM-67ERU_polyA"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mapping_id.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "mapping_id = mapping_id.set_index('tpm_col')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(659, 1)"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mapping_id.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "df  = df.join(mapping_id, how='inner', on = 'tpm_id')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gene_id</th>\n",
       "      <th>transcript_id(s)</th>\n",
       "      <th>length</th>\n",
       "      <th>effective_length</th>\n",
       "      <th>expected_count</th>\n",
       "      <th>TPM</th>\n",
       "      <th>FPKM</th>\n",
       "      <th>sample</th>\n",
       "      <th>sequencing_type</th>\n",
       "      <th>tpm_id</th>\n",
       "      <th>HUGO_gene</th>\n",
       "      <th>Tumor_Sample_Barcode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>ENSG00000000003.14_2_TSPAN6</td>\n",
       "      <td>ENST00000373020.8_1_TSPAN6-201,ENST00000494424...</td>\n",
       "      <td>1872.50</td>\n",
       "      <td>1630.51</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0.29</td>\n",
       "      <td>0.20</td>\n",
       "      <td>MO_1008-Tumor_Dura</td>\n",
       "      <td>tcap</td>\n",
       "      <td>MO_1008-Tumor_Dura_tcap</td>\n",
       "      <td>TSPAN6</td>\n",
       "      <td>MO_1008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>659</th>\n",
       "      <td>ENSG00000000005.6_3_TNMD</td>\n",
       "      <td>ENST00000373031.5_2_TNMD-201,ENST00000485971.1...</td>\n",
       "      <td>873.50</td>\n",
       "      <td>631.57</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>MO_1008-Tumor_Dura</td>\n",
       "      <td>tcap</td>\n",
       "      <td>MO_1008-Tumor_Dura_tcap</td>\n",
       "      <td>TNMD</td>\n",
       "      <td>MO_1008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1318</th>\n",
       "      <td>ENSG00000000419.12_3_DPM1</td>\n",
       "      <td>ENST00000371582.8_2_DPM1-201,ENST00000371584.8...</td>\n",
       "      <td>969.60</td>\n",
       "      <td>727.62</td>\n",
       "      <td>514.0</td>\n",
       "      <td>24.09</td>\n",
       "      <td>16.65</td>\n",
       "      <td>MO_1008-Tumor_Dura</td>\n",
       "      <td>tcap</td>\n",
       "      <td>MO_1008-Tumor_Dura_tcap</td>\n",
       "      <td>DPM1</td>\n",
       "      <td>MO_1008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977</th>\n",
       "      <td>ENSG00000000457.14_4_SCYL3</td>\n",
       "      <td>ENST00000367770.5_2_SCYL3-201,ENST00000367771....</td>\n",
       "      <td>3087.03</td>\n",
       "      <td>2845.03</td>\n",
       "      <td>155.0</td>\n",
       "      <td>1.86</td>\n",
       "      <td>1.28</td>\n",
       "      <td>MO_1008-Tumor_Dura</td>\n",
       "      <td>tcap</td>\n",
       "      <td>MO_1008-Tumor_Dura_tcap</td>\n",
       "      <td>SCYL3</td>\n",
       "      <td>MO_1008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2636</th>\n",
       "      <td>ENSG00000000460.17_6_C1orf112</td>\n",
       "      <td>ENST00000286031.10_4_C1orf112-201,ENST00000359...</td>\n",
       "      <td>3064.19</td>\n",
       "      <td>2822.19</td>\n",
       "      <td>87.0</td>\n",
       "      <td>1.05</td>\n",
       "      <td>0.73</td>\n",
       "      <td>MO_1008-Tumor_Dura</td>\n",
       "      <td>tcap</td>\n",
       "      <td>MO_1008-Tumor_Dura_tcap</td>\n",
       "      <td>C1orf112</td>\n",
       "      <td>MO_1008</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            gene_id  \\\n",
       "0       ENSG00000000003.14_2_TSPAN6   \n",
       "659        ENSG00000000005.6_3_TNMD   \n",
       "1318      ENSG00000000419.12_3_DPM1   \n",
       "1977     ENSG00000000457.14_4_SCYL3   \n",
       "2636  ENSG00000000460.17_6_C1orf112   \n",
       "\n",
       "                                       transcript_id(s)   length  \\\n",
       "0     ENST00000373020.8_1_TSPAN6-201,ENST00000494424...  1872.50   \n",
       "659   ENST00000373031.5_2_TNMD-201,ENST00000485971.1...   873.50   \n",
       "1318  ENST00000371582.8_2_DPM1-201,ENST00000371584.8...   969.60   \n",
       "1977  ENST00000367770.5_2_SCYL3-201,ENST00000367771....  3087.03   \n",
       "2636  ENST00000286031.10_4_C1orf112-201,ENST00000359...  3064.19   \n",
       "\n",
       "      effective_length  expected_count    TPM   FPKM              sample  \\\n",
       "0              1630.51            14.0   0.29   0.20  MO_1008-Tumor_Dura   \n",
       "659             631.57             0.0   0.00   0.00  MO_1008-Tumor_Dura   \n",
       "1318            727.62           514.0  24.09  16.65  MO_1008-Tumor_Dura   \n",
       "1977           2845.03           155.0   1.86   1.28  MO_1008-Tumor_Dura   \n",
       "2636           2822.19            87.0   1.05   0.73  MO_1008-Tumor_Dura   \n",
       "\n",
       "     sequencing_type                   tpm_id HUGO_gene Tumor_Sample_Barcode  \n",
       "0               tcap  MO_1008-Tumor_Dura_tcap    TSPAN6              MO_1008  \n",
       "659             tcap  MO_1008-Tumor_Dura_tcap      TNMD              MO_1008  \n",
       "1318            tcap  MO_1008-Tumor_Dura_tcap      DPM1              MO_1008  \n",
       "1977            tcap  MO_1008-Tumor_Dura_tcap     SCYL3              MO_1008  \n",
       "2636            tcap  MO_1008-Tumor_Dura_tcap  C1orf112              MO_1008  "
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "read_counts = pd.pivot_table(df,index=\"HUGO_gene\",columns=[\"Tumor_Sample_Barcode\"],values=\"expected_count\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(18887, 659)"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "read_counts.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>Tumor_Sample_Barcode</th>\n",
       "      <th>MO_1008</th>\n",
       "      <th>MO_1012</th>\n",
       "      <th>MO_1013</th>\n",
       "      <th>MO_1014</th>\n",
       "      <th>MO_1015</th>\n",
       "      <th>MO_1020</th>\n",
       "      <th>MO_1040</th>\n",
       "      <th>MO_1054</th>\n",
       "      <th>MO_1071</th>\n",
       "      <th>MO_1074</th>\n",
       "      <th>...</th>\n",
       "      <th>TP_2032</th>\n",
       "      <th>TP_2034</th>\n",
       "      <th>TP_2054</th>\n",
       "      <th>TP_2060</th>\n",
       "      <th>TP_2061</th>\n",
       "      <th>TP_2064</th>\n",
       "      <th>TP_2069</th>\n",
       "      <th>TP_2077</th>\n",
       "      <th>TP_2078</th>\n",
       "      <th>TP_2079</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>HUGO_gene</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A1BG</th>\n",
       "      <td>28.45</td>\n",
       "      <td>0.0</td>\n",
       "      <td>128.85</td>\n",
       "      <td>32.0</td>\n",
       "      <td>37.76</td>\n",
       "      <td>35.0</td>\n",
       "      <td>31.13</td>\n",
       "      <td>73.24</td>\n",
       "      <td>158.1</td>\n",
       "      <td>94.62</td>\n",
       "      <td>...</td>\n",
       "      <td>32.11</td>\n",
       "      <td>137.81</td>\n",
       "      <td>23.11</td>\n",
       "      <td>178.0</td>\n",
       "      <td>1323.82</td>\n",
       "      <td>35.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>14.28</td>\n",
       "      <td>22.75</td>\n",
       "      <td>167.47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A1CF</th>\n",
       "      <td>56.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>12.00</td>\n",
       "      <td>1240.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>134.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>11.0</td>\n",
       "      <td>136.00</td>\n",
       "      <td>...</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>126.00</td>\n",
       "      <td>201.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>433.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A2M</th>\n",
       "      <td>7038.00</td>\n",
       "      <td>2841.0</td>\n",
       "      <td>18252.00</td>\n",
       "      <td>6732.0</td>\n",
       "      <td>32590.00</td>\n",
       "      <td>23885.0</td>\n",
       "      <td>14963.00</td>\n",
       "      <td>46537.00</td>\n",
       "      <td>77667.0</td>\n",
       "      <td>34843.00</td>\n",
       "      <td>...</td>\n",
       "      <td>42573.00</td>\n",
       "      <td>15676.00</td>\n",
       "      <td>59007.00</td>\n",
       "      <td>54035.0</td>\n",
       "      <td>63389.00</td>\n",
       "      <td>24531.0</td>\n",
       "      <td>26792.0</td>\n",
       "      <td>17733.00</td>\n",
       "      <td>15028.00</td>\n",
       "      <td>1804.88</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A2ML1</th>\n",
       "      <td>50.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>22.00</td>\n",
       "      <td>28.0</td>\n",
       "      <td>1.00</td>\n",
       "      <td>85.0</td>\n",
       "      <td>37.00</td>\n",
       "      <td>117.00</td>\n",
       "      <td>35.0</td>\n",
       "      <td>3900.00</td>\n",
       "      <td>...</td>\n",
       "      <td>268.00</td>\n",
       "      <td>31.00</td>\n",
       "      <td>19.00</td>\n",
       "      <td>230.0</td>\n",
       "      <td>193.00</td>\n",
       "      <td>31.0</td>\n",
       "      <td>67.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>2687.00</td>\n",
       "      <td>21.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A3GALT2</th>\n",
       "      <td>4.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.00</td>\n",
       "      <td>3.00</td>\n",
       "      <td>3.0</td>\n",
       "      <td>10.00</td>\n",
       "      <td>...</td>\n",
       "      <td>0.00</td>\n",
       "      <td>2.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>156.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 659 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "Tumor_Sample_Barcode  MO_1008  MO_1012   MO_1013  MO_1014   MO_1015  MO_1020  \\\n",
       "HUGO_gene                                                                      \n",
       "A1BG                    28.45      0.0    128.85     32.0     37.76     35.0   \n",
       "A1CF                    56.00      0.0     12.00   1240.0      0.00    134.0   \n",
       "A2M                   7038.00   2841.0  18252.00   6732.0  32590.00  23885.0   \n",
       "A2ML1                   50.00      0.0     22.00     28.0      1.00     85.0   \n",
       "A3GALT2                  4.00      0.0      4.00      0.0      0.00      0.0   \n",
       "\n",
       "Tumor_Sample_Barcode   MO_1040   MO_1054  MO_1071   MO_1074   ...     \\\n",
       "HUGO_gene                                                     ...      \n",
       "A1BG                     31.13     73.24    158.1     94.62   ...      \n",
       "A1CF                      0.00      0.00     11.0    136.00   ...      \n",
       "A2M                   14963.00  46537.00  77667.0  34843.00   ...      \n",
       "A2ML1                    37.00    117.00     35.0   3900.00   ...      \n",
       "A3GALT2                   4.00      3.00      3.0     10.00   ...      \n",
       "\n",
       "Tumor_Sample_Barcode   TP_2032   TP_2034   TP_2054  TP_2060   TP_2061  \\\n",
       "HUGO_gene                                                               \n",
       "A1BG                     32.11    137.81     23.11    178.0   1323.82   \n",
       "A1CF                      0.00      0.00    126.00    201.0      0.00   \n",
       "A2M                   42573.00  15676.00  59007.00  54035.0  63389.00   \n",
       "A2ML1                   268.00     31.00     19.00    230.0    193.00   \n",
       "A3GALT2                   0.00      2.00      1.00      0.0      2.00   \n",
       "\n",
       "Tumor_Sample_Barcode  TP_2064  TP_2069   TP_2077   TP_2078  TP_2079  \n",
       "HUGO_gene                                                            \n",
       "A1BG                     35.0     26.0     14.28     22.75   167.47  \n",
       "A1CF                      0.0      7.0      0.00      0.00   433.00  \n",
       "A2M                   24531.0  26792.0  17733.00  15028.00  1804.88  \n",
       "A2ML1                    31.0     67.0      0.00   2687.00    21.00  \n",
       "A3GALT2                   0.0      0.0      2.00      0.00   156.00  \n",
       "\n",
       "[5 rows x 659 columns]"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "read_counts.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "read_counts = read_counts.astype('int32')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>Tumor_Sample_Barcode</th>\n",
       "      <th>MO_1008</th>\n",
       "      <th>MO_1012</th>\n",
       "      <th>MO_1013</th>\n",
       "      <th>MO_1014</th>\n",
       "      <th>MO_1015</th>\n",
       "      <th>MO_1020</th>\n",
       "      <th>MO_1040</th>\n",
       "      <th>MO_1054</th>\n",
       "      <th>MO_1071</th>\n",
       "      <th>MO_1074</th>\n",
       "      <th>...</th>\n",
       "      <th>TP_2032</th>\n",
       "      <th>TP_2034</th>\n",
       "      <th>TP_2054</th>\n",
       "      <th>TP_2060</th>\n",
       "      <th>TP_2061</th>\n",
       "      <th>TP_2064</th>\n",
       "      <th>TP_2069</th>\n",
       "      <th>TP_2077</th>\n",
       "      <th>TP_2078</th>\n",
       "      <th>TP_2079</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>HUGO_gene</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A1BG</th>\n",
       "      <td>28</td>\n",
       "      <td>0</td>\n",
       "      <td>128</td>\n",
       "      <td>32</td>\n",
       "      <td>37</td>\n",
       "      <td>35</td>\n",
       "      <td>31</td>\n",
       "      <td>73</td>\n",
       "      <td>158</td>\n",
       "      <td>94</td>\n",
       "      <td>...</td>\n",
       "      <td>32</td>\n",
       "      <td>137</td>\n",
       "      <td>23</td>\n",
       "      <td>178</td>\n",
       "      <td>1323</td>\n",
       "      <td>35</td>\n",
       "      <td>26</td>\n",
       "      <td>14</td>\n",
       "      <td>22</td>\n",
       "      <td>167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A1CF</th>\n",
       "      <td>56</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>1240</td>\n",
       "      <td>0</td>\n",
       "      <td>134</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11</td>\n",
       "      <td>136</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>126</td>\n",
       "      <td>201</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>433</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A2M</th>\n",
       "      <td>7038</td>\n",
       "      <td>2841</td>\n",
       "      <td>18252</td>\n",
       "      <td>6732</td>\n",
       "      <td>32590</td>\n",
       "      <td>23885</td>\n",
       "      <td>14963</td>\n",
       "      <td>46537</td>\n",
       "      <td>77667</td>\n",
       "      <td>34843</td>\n",
       "      <td>...</td>\n",
       "      <td>42573</td>\n",
       "      <td>15676</td>\n",
       "      <td>59007</td>\n",
       "      <td>54035</td>\n",
       "      <td>63389</td>\n",
       "      <td>24531</td>\n",
       "      <td>26792</td>\n",
       "      <td>17733</td>\n",
       "      <td>15028</td>\n",
       "      <td>1804</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A2ML1</th>\n",
       "      <td>50</td>\n",
       "      <td>0</td>\n",
       "      <td>22</td>\n",
       "      <td>28</td>\n",
       "      <td>1</td>\n",
       "      <td>85</td>\n",
       "      <td>37</td>\n",
       "      <td>117</td>\n",
       "      <td>35</td>\n",
       "      <td>3900</td>\n",
       "      <td>...</td>\n",
       "      <td>268</td>\n",
       "      <td>31</td>\n",
       "      <td>19</td>\n",
       "      <td>230</td>\n",
       "      <td>193</td>\n",
       "      <td>31</td>\n",
       "      <td>67</td>\n",
       "      <td>0</td>\n",
       "      <td>2687</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A3GALT2</th>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>156</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 659 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "Tumor_Sample_Barcode  MO_1008  MO_1012  MO_1013  MO_1014  MO_1015  MO_1020  \\\n",
       "HUGO_gene                                                                    \n",
       "A1BG                       28        0      128       32       37       35   \n",
       "A1CF                       56        0       12     1240        0      134   \n",
       "A2M                      7038     2841    18252     6732    32590    23885   \n",
       "A2ML1                      50        0       22       28        1       85   \n",
       "A3GALT2                     4        0        4        0        0        0   \n",
       "\n",
       "Tumor_Sample_Barcode  MO_1040  MO_1054  MO_1071  MO_1074   ...     TP_2032  \\\n",
       "HUGO_gene                                                  ...               \n",
       "A1BG                       31       73      158       94   ...          32   \n",
       "A1CF                        0        0       11      136   ...           0   \n",
       "A2M                     14963    46537    77667    34843   ...       42573   \n",
       "A2ML1                      37      117       35     3900   ...         268   \n",
       "A3GALT2                     4        3        3       10   ...           0   \n",
       "\n",
       "Tumor_Sample_Barcode  TP_2034  TP_2054  TP_2060  TP_2061  TP_2064  TP_2069  \\\n",
       "HUGO_gene                                                                    \n",
       "A1BG                      137       23      178     1323       35       26   \n",
       "A1CF                        0      126      201        0        0        7   \n",
       "A2M                     15676    59007    54035    63389    24531    26792   \n",
       "A2ML1                      31       19      230      193       31       67   \n",
       "A3GALT2                     2        1        0        2        0        0   \n",
       "\n",
       "Tumor_Sample_Barcode  TP_2077  TP_2078  TP_2079  \n",
       "HUGO_gene                                        \n",
       "A1BG                       14       22      167  \n",
       "A1CF                        0        0      433  \n",
       "A2M                     17733    15028     1804  \n",
       "A2ML1                       0     2687       21  \n",
       "A3GALT2                     2        0      156  \n",
       "\n",
       "[5 rows x 659 columns]"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "read_counts.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "filename = join(PROSTATE_DATA_PATH,'processed/p1000_read_counts.csv')\n",
    "read_counts.to_csv(filename)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(18887, 659)"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "read_counts.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## get interesting gene amplifications"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "filename = join(PROSTATE_DATA_PATH,'processed/P1000_data_CNA_paper.csv')\n",
    "\n",
    "cnv = pd.read_csv(filename, index_col=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PIK3CD</th>\n",
       "      <th>MTOR</th>\n",
       "      <th>JUN</th>\n",
       "      <th>NRAS</th>\n",
       "      <th>NOTCH2</th>\n",
       "      <th>RIT1</th>\n",
       "      <th>NTRK1</th>\n",
       "      <th>DDR2</th>\n",
       "      <th>MDM4</th>\n",
       "      <th>PARP1</th>\n",
       "      <th>...</th>\n",
       "      <th>MCAM</th>\n",
       "      <th>RNF26</th>\n",
       "      <th>C1QTNF5</th>\n",
       "      <th>MFRP</th>\n",
       "      <th>USP2</th>\n",
       "      <th>LOC100499227</th>\n",
       "      <th>THY1</th>\n",
       "      <th>PVRL1</th>\n",
       "      <th>TRIM29</th>\n",
       "      <th>OAF</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>00-029N9_LN</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>01-087MM_BONE</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>01-095N1_LN</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>01-120A1_LIVER</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>-2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>02-083E1_LN</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 13802 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                PIK3CD  MTOR  JUN  NRAS  NOTCH2  RIT1  NTRK1  DDR2  MDM4  \\\n",
       "00-029N9_LN        0.0   0.0  0.0   0.0     0.0   0.0    0.0   0.0   0.0   \n",
       "01-087MM_BONE      0.0   0.0  0.0   0.0     0.0   0.0    0.0   0.0   0.0   \n",
       "01-095N1_LN        1.0   0.0  0.0   0.0     0.0   0.0    1.0   0.0   0.0   \n",
       "01-120A1_LIVER     0.0   0.0  0.0   0.0     0.0   0.0    0.0   0.0   0.0   \n",
       "02-083E1_LN        1.0   0.0  0.0   0.0     0.0   0.0    0.0   0.0   1.0   \n",
       "\n",
       "                PARP1 ...   MCAM  RNF26  C1QTNF5  MFRP  USP2  LOC100499227  \\\n",
       "00-029N9_LN       0.0 ...    0.0    0.0      0.0   0.0   0.0           0.0   \n",
       "01-087MM_BONE     1.0 ...   -1.0   -1.0     -1.0  -1.0  -1.0          -1.0   \n",
       "01-095N1_LN       0.0 ...    1.0    1.0      1.0   1.0   1.0           1.0   \n",
       "01-120A1_LIVER    1.0 ...    0.0    0.0      0.0   0.0  -2.0          -2.0   \n",
       "02-083E1_LN       0.0 ...    2.0    2.0      2.0   2.0   2.0           2.0   \n",
       "\n",
       "                THY1  PVRL1  TRIM29  OAF  \n",
       "00-029N9_LN      0.0    0.0     0.0  0.0  \n",
       "01-087MM_BONE   -1.0   -1.0    -1.0 -1.0  \n",
       "01-095N1_LN      1.0    1.0     1.0  1.0  \n",
       "01-120A1_LIVER  -2.0   -2.0    -2.0 -2.0  \n",
       "02-083E1_LN      2.0    2.0     2.0  2.0  \n",
       "\n",
       "[5 rows x 13802 columns]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cnv.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "new_index = read_counts.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "cnv_updated = cnv.reindex(new_index)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PIK3CD</th>\n",
       "      <th>MTOR</th>\n",
       "      <th>JUN</th>\n",
       "      <th>NRAS</th>\n",
       "      <th>NOTCH2</th>\n",
       "      <th>RIT1</th>\n",
       "      <th>NTRK1</th>\n",
       "      <th>DDR2</th>\n",
       "      <th>MDM4</th>\n",
       "      <th>PARP1</th>\n",
       "      <th>...</th>\n",
       "      <th>MCAM</th>\n",
       "      <th>RNF26</th>\n",
       "      <th>C1QTNF5</th>\n",
       "      <th>MFRP</th>\n",
       "      <th>USP2</th>\n",
       "      <th>LOC100499227</th>\n",
       "      <th>THY1</th>\n",
       "      <th>PVRL1</th>\n",
       "      <th>TRIM29</th>\n",
       "      <th>OAF</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Tumor_Sample_Barcode</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>MO_1008</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1012</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1013</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1014</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1015</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 13802 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                      PIK3CD  MTOR  JUN  NRAS  NOTCH2  RIT1  NTRK1  DDR2  \\\n",
       "Tumor_Sample_Barcode                                                       \n",
       "MO_1008                  0.0   0.0  0.0   1.0     1.0   0.0    0.0   0.0   \n",
       "MO_1012                  1.0   2.0  1.0   1.0     1.0   1.0    1.0   1.0   \n",
       "MO_1013                  0.0   0.0  0.0   0.0     0.0   1.0    1.0   1.0   \n",
       "MO_1014                  0.0   0.0  0.0   0.0     1.0   0.0    0.0   0.0   \n",
       "MO_1015                  0.0   0.0  0.0   0.0     0.0   0.0    0.0   1.0   \n",
       "\n",
       "                      MDM4  PARP1 ...   MCAM  RNF26  C1QTNF5  MFRP  USP2  \\\n",
       "Tumor_Sample_Barcode              ...                                      \n",
       "MO_1008                0.0    0.0 ...   -1.0   -1.0     -1.0  -1.0  -1.0   \n",
       "MO_1012                1.0    1.0 ...   -1.0   -1.0     -1.0  -1.0  -1.0   \n",
       "MO_1013                1.0    1.0 ...    0.0    0.0      0.0   0.0   0.0   \n",
       "MO_1014                0.0    0.0 ...    1.0    1.0      1.0   1.0   1.0   \n",
       "MO_1015                0.0    1.0 ...    0.0    0.0      0.0   0.0   0.0   \n",
       "\n",
       "                      LOC100499227  THY1  PVRL1  TRIM29  OAF  \n",
       "Tumor_Sample_Barcode                                          \n",
       "MO_1008                       -1.0  -1.0   -1.0    -1.0 -1.0  \n",
       "MO_1012                       -1.0  -1.0   -1.0    -1.0 -1.0  \n",
       "MO_1013                        0.0   0.0    0.0     0.0  0.0  \n",
       "MO_1014                        1.0   1.0    1.0     1.0  1.0  \n",
       "MO_1015                        0.0   0.0    0.0     0.0  1.0  \n",
       "\n",
       "[5 rows x 13802 columns]"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cnv_updated.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "cnv_MDM4 = cnv_updated[['MDM4']].copy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>MDM4</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Tumor_Sample_Barcode</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>MO_1008</th>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1012</th>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1013</th>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1014</th>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1015</th>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      MDM4\n",
       "Tumor_Sample_Barcode      \n",
       "MO_1008                0.0\n",
       "MO_1012                1.0\n",
       "MO_1013                1.0\n",
       "MO_1014                0.0\n",
       "MO_1015                0.0"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cnv_MDM4.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": [
    "mapp_dict= {-2:'Low', -1:'Low', 0:'Low', 1.0:'High', 2.0: 'High'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{-2: 'Low', -1: 'Low', 0: 'Low', 1.0: 'High', 2.0: 'High'}"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mapp_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [],
   "source": [
    "cnv_MDM4.MDM4.replace(mapp_dict, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>MDM4</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Tumor_Sample_Barcode</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>MO_1008</th>\n",
       "      <td>Low</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1012</th>\n",
       "      <td>High</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1013</th>\n",
       "      <td>High</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1014</th>\n",
       "      <td>Low</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MO_1015</th>\n",
       "      <td>Low</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      MDM4\n",
       "Tumor_Sample_Barcode      \n",
       "MO_1008                Low\n",
       "MO_1012               High\n",
       "MO_1013               High\n",
       "MO_1014                Low\n",
       "MO_1015                Low"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cnv_MDM4.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>response</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>AAPC-STID0000011640-Tumor-SM-2XU1H</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAPC-STID0000021561-Tumor-SM-3RVWB</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAPC-STID0000011949-Tumor-SM-2XU1I</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAPC-STID0000021610-Tumor-SM-2XU13</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAPC-STID0000021537-Tumor-SM-3RVW7</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                    response\n",
       "id                                          \n",
       "AAPC-STID0000011640-Tumor-SM-2XU1H         0\n",
       "AAPC-STID0000021561-Tumor-SM-3RVWB         0\n",
       "AAPC-STID0000011949-Tumor-SM-2XU1I         0\n",
       "AAPC-STID0000021610-Tumor-SM-2XU13         0\n",
       "AAPC-STID0000021537-Tumor-SM-3RVW7         0"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response_file = join(PROSTATE_DATA_PATH,'processed/response_paper.csv')\n",
    "response = pd.read_csv(response_file, index_col =0)\n",
    "response.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [],
   "source": [
    "filename = join(PROSTATE_DATA_PATH,'processed/MDM4_amps.csv')\n",
    "to_be_Saved = cnv_MDM4.join(response)\n",
    "to_be_Saved.to_csv(filename)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "cnv_PDGFA = cnv_updated[['PDGFA']].copy()\n",
    "cnv_NOTCH1 = cnv_updated[['NOTCH1']].copy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [],
   "source": [
    "cnv_NOTCH1.NOTCH1.replace(mapp_dict, inplace=True)\n",
    "cnv_PDGFA.PDGFA.replace(mapp_dict, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [],
   "source": [
    "filename = join(PROSTATE_DATA_PATH,'processed/NOTCH1_amps.csv')\n",
    "to_be_Saved = cnv_NOTCH1.join(response)\n",
    "to_be_Saved.to_csv(filename)\n",
    "\n",
    "\n",
    "\n",
    "filename = join(PROSTATE_DATA_PATH,'processed/PDGFA_amps.csv')\n",
    "to_be_Saved = cnv_PDGFA.join(response)\n",
    "to_be_Saved.to_csv(filename)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:min_env]",
   "language": "python",
   "name": "conda-env-min_env-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
